<template>
  <div class="flex-1 m-l-15">
    <el-table
        size="mini"
        highlight-current-row
        class="view-table"
        :data="tableData"
        border
        style="width: calc(100vw - 550px);max-width: calc(100vw - 550px);">

        <el-table-column
        prop="positionnum"
        align="center"
        width="180"
        label="成交编号">
        </el-table-column>

        <el-table-column
        prop="contract"
        align="center"
        width="120"
        label="合约">
        </el-table-column>

        <el-table-column
        prop="risefall"
        align="center"
        label="买卖">
            <template slot-scope="scope">
              <div  class=" fz-14 C_333">{{ scope.row.risefall == 'rise' ? '买':'卖'}}</div>
            </template>
        </el-table-column>

        <el-table-column
        prop="status"
        align="center"
        label="开平">
            <template slot-scope="scope">
              <div  class=" fz-14 C_333">{{ scope.row.status == 'open' ? '开':'平'}}</div>
            </template>
        </el-table-column>

        <el-table-column
        prop="volume"
        align="center"
        label="数量">
        </el-table-column>

        <el-table-column
        prop="playprice"
        align="center"
        label="成交价">
        </el-table-column>

        <el-table-column
        prop="fee"
        align="center"
        label="手续费">
        </el-table-column>

        <el-table-column
        prop="dealtime"
        align="center"
        width="180"
        label="成交时间">
            <template slot-scope="scope">
              <div  class=" fz-12 C_333" style="font-size:12px;">{{ moment.unix(scope.row.createtime).format('YYYY-MM-DD HH:mm:ss')}}</div>
            </template>
        </el-table-column>


    </el-table>
  </div>
</template>

<script>
import { mapState } from 'vuex';
import moment from 'moment'
export default {
  props: ['date'],
  components: {
    
  },
  computed: mapState({
    select: state => state.trade.select /* 当前选中股指 */,
    symbol: state => state.trade.symbol /* 全部行情 */,
    symbos: state => state.trade.symbos /* 当前页面显示杨青 */,
    ticket: state => state.trade.ticket /* 推送数据 */,
    optionlist: state => state.trade.optionlist /* 全部合约代码 */
  }),
  watch: {
    ticket:{
　　　　handler: function(val) {
        
　　　　},
      immediate: true,
　　　 deep:true
　　},
  },
  data() {
    return {
      moment: moment,
      selectItem: {},
      tableData: []
    };
  },
  computed: {
    
  },
  created: function() {
    this.getList();
  },
  methods: {
    getList() {
       let startday = this.date[0]
       let endday = this.date[1]
       this.$get('/funds/dealorders', {startday:startday, endday: endday }).then(res => {
         this.tableData = res.data
       })
    }
  }
};
</script>

<style scoped lang="less">
</style>
